package org.linlinjava.litemall.db.service;

import com.github.yulichang.base.MPJBaseServiceImpl;
import org.linlinjava.litemall.db.dao.LumiereLevelMemberMapper;
import org.linlinjava.litemall.db.domain.LumiereLevelMember;
import org.linlinjava.litemall.db.domain.LumiereLevelMemberExample;
import org.linlinjava.litemall.db.domain.LumierePayMember;
import org.linlinjava.litemall.db.domain.LumierePayMemberExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LumierelLevelMemberService extends MPJBaseServiceImpl<LumiereLevelMemberMapper,LumiereLevelMember> {
    @Resource
    private LumiereLevelMemberMapper lumiereLevelMemberMapper;

    public Integer add(LumiereLevelMember lumiereLevelMember){
        Integer count = lumiereLevelMemberMapper.insert(lumiereLevelMember);
        return count;
    }

    public Integer update(LumiereLevelMember lumiereLevelMember){
        Integer count = lumiereLevelMemberMapper.updateByPrimaryKey(lumiereLevelMember);
        return count;
    }

    public Integer delete(Integer memberId){
        Integer count = lumiereLevelMemberMapper.logicalDeleteByPrimaryKey(memberId);
        return count;
    }

    public List<LumiereLevelMember> list(LumiereLevelMemberExample example){
        return lumiereLevelMemberMapper.selectByExample(example);
    }

    public LumiereLevelMember queryByPid(Integer id){
        LumiereLevelMemberExample example = new LumiereLevelMemberExample();
        example.or().andDeletedEqualTo(false).andPidEqualTo(id);
        return lumiereLevelMemberMapper.selectOneByExample(example);
    }

    public LumiereLevelMember queryByPidInDel(Integer id){
        LumiereLevelMemberExample example = new LumiereLevelMemberExample();
        example.or().andPidEqualTo(id).andDeletedEqualTo(false);
        return lumiereLevelMemberMapper.selectOneByExample(example);
    }

    public LumiereLevelMember findById(Integer memberId){
        return lumiereLevelMemberMapper.selectByPrimaryKey(memberId);
    }

    public List<LumiereLevelMember> findByName(String name){
        LumiereLevelMemberExample example = new LumiereLevelMemberExample();
        example.or().andDeletedEqualTo(false).andNameEqualTo(name);

        return lumiereLevelMemberMapper.selectByExample(example);
    }




}
